<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<html>
	<head>
		<title>Test Poi Page</title>
	</head>
	<body>
		<a href="/testPoi/download/${fileName}" target="_blank">Dowload template</a> <br>
		
		 <form:form method="post" action="/savefiles"
            modelAttribute="uploadForm" enctype="multipart/form-data">
 
            <p>Select files to upload. Press Add button to add more file
                inputs.</p>
 
            <table id="fileTable">
                <tr>
                    <td><input name="files[0]" type="file" /></td>
                </tr>
                <tr>
                    <td><input name="files[1]" type="file" /></td>
                </tr>
            </table>
            <br />
            <input type="submit" value="Upload" />
            <input id="addFile" type="button" value="Add File" />
        </form:form>
		
		<a href="#">view report</a> 
	</body>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
	<script>
	    $(document).ready(function(){
			//add more file components if Add is clicked
			$('#addFile').click(function() {
				var fileIndex = $('#fileTable tr').children().length - 1;
				$('#fileTable').append('<tr><td>'
					+ '<input type="file" name="files['+ fileIndex +']" />'
					+ '</td></tr>');
			});
		});
	</script>

</html>